<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
$(document).ready(function(){
  	$("#performances").each(function(){
  		$(this).find("tr:even").addClass("li_1");
  		$(this).find("tr:odd").addClass("li_2");
  	});
  	 var test = parseInt($("#domestic_junior_cooperation").val())+parseInt($("#domestic_research_cooperation").val())+parseInt($("#domestic_enterprise_cooperation").val())+
		 parseInt($("#abroad_junior_cooperation").val())+parseInt($("#abroad_research_cooperation").val())+parseInt($("#abroad_enterprise_cooperation").val());
	if(test>0){
	$("#cooperativeunit_color").show();
	$("#cooperativeunit").find("input:text").addClass("required");
	}else{
	$("#cooperativeunit_color").hide();
	$("#cooperativeunit").find("input:text").removeClass("required");
	}
  });
  function cooperativeunit(){
	  var test = parseInt($("#domestic_junior_cooperation").val())+parseInt($("#domestic_research_cooperation").val())+parseInt($("#domestic_enterprise_cooperation").val())+
	  			 parseInt($("#abroad_junior_cooperation").val())+parseInt($("#abroad_research_cooperation").val())+parseInt($("#abroad_enterprise_cooperation").val());
	  if(test>0){
		  $("#cooperativeunit_color").show();
		  $("#cooperativeunit").find("input:text").addClass("required");
	  }else{
		  $("#cooperativeunit_color").hide();
		  $("#cooperativeunit").find("input:text").removeClass("required");
	  }
  }
  function initTreeValueExt(treeId, treeNode) {

		var inputId = treeId.substring(0, treeId.lastIndexOf('_'));
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val("");
				$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val("");
			}
			return false;
			}
			var str = treeNode.name;
			var obj = treeNode.parentNode;
			while (obj != null) {
				//str = obj.name + "-" + str;
				obj = obj.parentNode;
			}
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_code'],[id$='" + inputId+ "_code']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_value'],[id$='" + inputId+ "_value']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + inputId + "_name'],[id$='" + inputId+ "_name']").val(str);
		}
</script>	
<table class="t_css table01" width="100%" border="0" cellpadding="0" id="performances" cellspacing="1">
	<col style="width: 10%" />
	<col style="width: 20%" />
	<col style="width: 14%" />
	<col style="width: 14%" />
	<col style="width: 14%" />
	<col style="width: 14%" />
	<col style="width: 14%" />
	<tr>
		<td class="t_bar2" colspan="7"><span class="color_red">*</span>合作单位情况</td>
	</tr>
	<tr>
		<td colspan="7" align="right">单位：家</td>
	</tr>
	<tr>
		<td rowspan="2" colspan="2" align="center">合作单位性质</td>
		<td rowspan="2" align="center">合作单位个数</td>
		<td colspan="4" align="center">不同合作方式的单位个数</td>
	</tr>
	<tr>
		<td align="center">共同研究</td>
		<td align="center">委托生产加工</td>
		<td align="center">咨询服务</td>
		<td align="center">其他</td>
	</tr>
	<tr>
		<td rowspan="3" align="center">国内机构</td>
		<td align="center">大专院校</td>
		<td><input type="text" id="domestic_junior_cooperation" name="performance/domestic_junior_cooperation" label="国内机构-->大专院校-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_junior_cooperation" />"  /></td>
		<td><input type="text" id="domestic_junior_research" name="performance/domestic_junior_research" label="国内机构-->大专院校-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_junior_research" />"  /></td>
		<td><input type="text" id="domestic_junior_machining" name="performance/domestic_junior_machining" label="国内机构-->大专院校-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_junior_machining" />"  /></td>
		<td><input type="text" id="domestic_junior_service" name="performance/domestic_junior_service" label="国内机构-->大专院校-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_junior_service" />"  /></td>
		<td><input type="text" id="domestic_junior_other" name="performance/domestic_junior_other" label="国内机构-->大专院校-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_junior_other" />"  /></td>
	</tr>
	<tr>
		<td align="center">科研机构</td>
		<td><input type="text" id="domestic_research_cooperation" name="performance/domestic_research_cooperation" label="国内机构-->科研机构-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_research_cooperation" />"  /></td>
		<td><input type="text" id="domestic_research_research" name="performance/domestic_research_research" label="国内机构-->科研机构-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_research_research" />"  /></td>
		<td><input type="text" id="domestic_research_machining" name="performance/domestic_research_machining" label="国内机构-->科研机构-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_research_machining" />"  /></td>
		<td><input type="text" id="domestic_research_service" name="performance/domestic_research_service" label="国内机构-->科研机构-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_research_service" />"  /></td>
		<td><input type="text" id="domestic_research_other" name="performance/domestic_research_other" label="国内机构-->科研机构-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_research_other" />"  /></td>
	</tr>
	<tr>
		<td align="center">企业</td>
		<td><input type="text" id="domestic_enterprise_cooperation" name="performance/domestic_enterprise_cooperation" label="国内机构-->企业-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_enterprise_cooperation" />"  /></td>
		<td><input type="text" id="domestic_enterprise_research" name="performance/domestic_enterprise_research" label="国内机构-->企业-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_enterprise_research" />"  /></td>
		<td><input type="text" id="domestic_enterprise_machining" name="performance/domestic_enterprise_machining" label="国内机构-->企业-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_enterprise_machining" />"  /></td>
		<td><input type="text" id="domestic_enterprise_service" name="performance/domestic_enterprise_service" label="国内机构-->企业-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_enterprise_service" />"  /></td>
		<td><input type="text" id="domestic_enterprise_other" name="performance/domestic_enterprise_other" label="国内机构-->企业-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/domestic_enterprise_other" />"  /></td>
	</tr>
	<tr>
		<td rowspan="3" align="center">国外机构</td>
		<td align="center">大专院校</td>
		<td><input type="text" id="abroad_junior_cooperation" name="performance/abroad_junior_cooperation" label="国外机构-->大专院校-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_junior_cooperation" />"  /></td>
		<td><input type="text" id="abroad_junior_research" name="performance/abroad_junior_research" label="国外机构-->大专院校-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_junior_research" />"  /></td>
		<td><input type="text" id="abroad_junior_machining" name="performance/abroad_junior_machining" label="国外机构-->大专院校-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_junior_machining" />"  /></td>
		<td><input type="text" id="abroad_junior_service" name="performance/abroad_junior_service" label="国外机构-->大专院校-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_junior_service" />"  /></td>
		<td><input type="text" id="abroad_junior_other" name="performance/abroad_junior_other" label="国外机构-->大专院校-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_junior_other" />"  /></td>
	</tr>
	<tr>
		<td align="center">科研机构</td>
		<td><input type="text" id="abroad_research_cooperation" name="performance/abroad_research_cooperation" label="国外机构-->科研机构-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_research_cooperation" />"  /></td>
		<td><input type="text" id="abroad_research_research" name="performance/abroad_research_research" label="国外机构-->科研机构-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_research_research" />"  /></td>
		<td><input type="text" id="abroad_research_machining" name="performance/abroad_research_machining" label="国外机构-->科研机构-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_research_machining" />"  /></td>
		<td><input type="text" id="abroad_research_service" name="performance/abroad_research_service" label="国外机构-->科研机构-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_research_service" />"  /></td>
		<td><input type="text" id="abroad_research_other" name="performance/abroad_research_other" label="国外机构-->科研机构-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_research_other" />"  /></td>
	</tr>
	<tr>
		<td align="center">企业</td>
		<td><input type="text" id="abroad_enterprise_cooperation" name="performance/abroad_enterprise_cooperation" label="国外机构-->企业-->合作单位个数" class="required" onfocus="InitInput.setNumber(this,7,0,0)" onchange="cooperativeunit();" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_enterprise_cooperation" />"  /></td>
		<td><input type="text" id="abroad_enterprise_research" name="performance/abroad_enterprise_research" label="国外机构-->企业-->不同合作方式的单位个数-->共同研究" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_enterprise_research" />"  /></td>
		<td><input type="text" id="abroad_enterprise_machining" name="performance/abroad_enterprise_machining" label="国外机构-->企业-->不同合作方式的单位个数-->委托生产加工" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_enterprise_machining" />"  /></td>
		<td><input type="text" id="abroad_enterprise_service" name="performance/abroad_enterprise_service" label="国外机构-->企业-->不同合作方式的单位个数-->咨询服务" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_enterprise_service" />"  /></td>
		<td><input type="text" id="abroad_enterprise_other" name="performance/abroad_enterprise_other" label="国外机构-->企业-->不同合作方式的单位个数-->其他" class="required" onfocus="InitInput.setNumber(this,7,0,0)" style="width: 90%;text-align: right;" value="<x:out select="$xmlData/data/performance/abroad_enterprise_other" />"  /></td>
	</tr>
</table>
<div class="t_bar2"
	style="height: 30px; margin-bottom: -10px; padding-top: 5px; text-align: left;"><span class="color_red" id="cooperativeunit_color" style="display: none">*</span>合作单位信息(限5条)</div>
<table class="t_css  table01" width="100%" border="0" cellpadding="0" id="cooperativeunit"cellspacing="1">
		<col style="width: 5%" />
		<col style="width: 5%" />
		<col style="width: 30%" />
		<col style="width: 15%" />
		<col style="width: 15%" />
		<col style="width: 15%" />
		<col style="width: 15%" />
		<thead>
		<th>选择</th>
		<th>序号</th>
		<th>合作单位名称</th>
		<th>合作内容</th>
		<th>合作方式</th>
		<th>合作时间</th>
		<th>合作方联系人</th>
		</thead>
		<tbody id="tab">
		<tr style="display: none" align="center">
			<td align="center"><input type="radio" class="radiobutton" 
				name="selfund_cooperativeunit"></td>
			<td align="center"><span name="cooperativeunits|cooperativeunit[0]@seq_no">[index]</span>
			</td>
			<td align="center"><input 
				name="cooperativeunits|cooperativeunit[0]|company_name" label="合作单位名称" value=""
				class="required input_text" style="width: 90%;" maxlength="20" /></td>
				<td align="center">
			<input name="cooperativeunits|cooperativeunit[0]|company_content" label="合作内容" value=""
				class="required input_text" style="width: 90%;" maxlength="20" />
			</td>
			<td align="center"><cpt:select id="cooperation_mode[index]" 
					name="cooperation_mode" key="cooperation_mode" 
					onChange="initControlValue(this.id);" style="width:90%"></cpt:select>
				<input type="hidden" name="cooperativeunits|cooperativeunit[0]|cooperation_mode_value"
				class="required" label="合作方式" value="" /> <input type="hidden" 
				name="cooperativeunits|cooperativeunit[0]|cooperation_mode_name" id="cooperation_mode_name"  value="" /></td>
			<td align="center">
			       <input id="cooperativeunit_cooperation_date_[0]"
				name="cooperativeunits|cooperativeunit[0]|cooperation_date" label="合作时间" value="" class=" input_text date"	style="width: 70%"  />
			</td>
			<td align="center">
			<input name="cooperativeunits|cooperativeunit[0]|company_contact" label="合作方联系人" value=""
				class="required input_text" style="width: 90%;" maxlength="20" />
			</td>
		</tr>
		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/cooperativeunits/cooperativeunit" var="cooperativeunit">
			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr align="center">
				<td><input type="radio" class="radiobutton" name="selfund_cooperativeunit"></td>
				<td align="center"><span name="cooperativeunits/cooperativeunit[${flag}${index}]@seq_no"><x:out select="$cooperativeunit/@seq_no" /></span></td>
				<td><input id="company_name_[${flag}${index}]" value="<x:out select="$cooperativeunit/company_name"/>"label="合作单位名称" name="cooperativeunits/cooperativeunit[${flag}${index}]/company_name" maxlength="20" class="required input_text" style="width: 90%" /></td>
				<td><input id="company_content_[${flag}${index}]" value="<x:out select="$cooperativeunit/company_content"/>"label="合作内容" name="cooperativeunits/cooperativeunit[${flag}${index}]/company_content" maxlength="20" class="required input_text" style="width: 90%" /></td>
				<td align="center"><c:set var="cooperation_mode_value"><x:out select="$cooperativeunit/cooperation_mode_value" /></c:set> 
				<cpt:select id="cooperation_mode${index}" value="${cooperation_mode_value }" key="cooperation_mode" name="cooperation_mode" onChange="initControlValue(this.id);"  style="width:90%"></cpt:select>
					<input type="hidden" name="cooperativeunits/cooperativeunit[${flag}${index}]/cooperation_mode_value" class="required" label="合作方式" value="<x:out select="$cooperativeunit/cooperation_mode_value" />" /> 
					<input type="hidden" name="cooperativeunits/cooperativeunit[${flag}${index}]/cooperation_mode_name" value="<x:out select="$cooperativeunit/cooperation_mode_name" />" /></td>
					<td align="center">
					<c:set var="cooperation_date" scope="page"><x:out select="$cooperativeunit/cooperation_date" /></c:set> 
					<input id="cooperativeunit_cooperation_date_[${flag}${index}]" value="${cooperation_date}" label="购进时间"
					name="cooperativeunits/cooperativeunit[${flag}${index}]/cooperation_date" class="date input_text"style="width: 70%" />
				</td>
				<td><input id="company_contact_[${flag}${index}]"value="<x:out select="$cooperativeunit/company_contact"/>"label="合作方联系人"name="cooperativeunits/cooperativeunit[${flag}${index}]/company_contact" class="required input_text" maxlength="20" style="width: 90%;" /></td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
		<script type="text/javascript">
			showAllDateTag("cooperativeunit");
		</script>
	</tbody>
</table>
<table width="100%" align="center">
	<tr>
		<td>
		<input class="button" name="cmdAddbefore" type=button
			value="添加"
			onclick="if(checkTabLimit('cooperativeunit','5','最多只能添加5条合作单位信息')){addNewRow('cooperativeunit');showDateTag('cooperativeunit');}try{top.resizeFrame();}catch(e){};">
			<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('cooperativeunit','selfund_cooperativeunit')"> 
			<input class="button" name="cmdMoveNext" type=button value="下移"onclick="moveNext('cooperativeunit','selfund_cooperativeunit')"> 
			<input class="button" name="cmddel" type=button value="删除" onclick="deleteSelectedRow('cooperativeunit','合作单位信息');"></td>
	</tr>
</table>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：填写5家合作最密切的单位，合作方式为共同研究、产业延伸、联手经营、其他。
